#!/usr/bin/env python
# -*- coding: UTF-8 -*-

import config
import re
import tweepy
import tweetdec

def main():
	# twitter config #
	TWITTER_CONSUMER_KEY = 'BEuvY8UpWye6ISpyJVFgw'
	TWITTER_CONSUMER_SECRET = 'nxkmPVWwRBmV3yEDahoRAsaVkudRuEUvQQs8Sfr2A'

	# citera_tan
#	TWITTER_ACCESS_TOKEN = '244560430-GwTKuepyOQgmm6J2gAmQP3nJQiJsytuqSAzMQ7oM'
#	TWITTER_ACCESS_SECRET = 'xvIej1SPjNy4UbTq9MHCoaUPfQ7FPdVDE9SjAzLs6E'

	# yuhki50
	TWITTER_ACCESS_TOKEN = '15805561-AJmJsYBuWCRCiKNv1dQa77JLfRMInxl1cQhRP1EIX'
	TWITTER_ACCESS_SECRET = 'D8mZbXmKigmkMX2rqVIlFUhFyrarlAKiE2PM9w'


#	try:
	# OAuth認証 #
	auth = tweepy.OAuthHandler(TWITTER_CONSUMER_KEY, TWITTER_CONSUMER_SECRET)
	auth.set_access_token(TWITTER_ACCESS_TOKEN, TWITTER_ACCESS_SECRET)
	api = tweepy.API(auth_handler = auth, secure = True)


	# あいさつ #
#	api.update_status('')

	# タイムライン取得 #
	for status in tweepy.Cursor(api.friends_timeline).items(10):
		# リプライ返し #


		# ツイートに反応 #
		print status.user.name + " / " + status.user.screen_name
#		if re.search("電子工作", status.text) != None:
		print status.text
		print


#	# 自動フォロー・リムーブ #
#	friendList = set(api.friends_ids())
#	followerList = set(api.followers_ids())
#
#	followList = followerList - friendList
#	removeList = friendList - followerList
#
#	for followId in followList:
#		api.create_friendship(followId)
#
#	for removeId in removeList:
#		api.destory_friendsship(removeId)



#	except KeyboardInterrupt:
#		print "\rexit!"

#	except Exception:
#		print "Exception"


if __name__ == "__main__":
	main()

